package com.freesky.biz.psbc.controller;

import com.freesky.biz.abchina.domain.TMaotaiCountRecord;
import com.freesky.biz.abchina.domain.TMaotaiRecord;
import com.freesky.biz.abchina.domain.TMaotaiShare;
import com.freesky.biz.abchina.service.IMaotaiRecordService;
import com.freesky.biz.psbc.domain.TPsbcCouponMarket;
import com.freesky.biz.psbc.service.IPsbcCouponMarketService;
import com.freesky.common.annotation.Log;
import com.freesky.common.core.controller.BaseController;
import com.freesky.common.core.domain.AjaxResult;
import com.freesky.common.core.page.TableDataInfo;
import com.freesky.common.enums.BusinessType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

@RestController
@RequestMapping("/psbc/couponMakert/")
public class PsbcCouponMarketController extends BaseController {

    @Autowired
    private IPsbcCouponMarketService psbcCouponMarketService;

    /**
     * 邮储银行列表
     */
    @PreAuthorize("@ss.hasPermi('psbc:couponMakert:list')")
    @GetMapping("/list")
    public TableDataInfo list(TPsbcCouponMarket psbcCouponMarket) {
        startPage();
        List<TPsbcCouponMarket> list = psbcCouponMarketService.findList(psbcCouponMarket);
        return getDataTable(list);
    }

    @Log(title = "邮储银行", businessType = BusinessType.EXPORT)
    @PreAuthorize("@ss.hasPermi('psbc:couponMakert:export')")
    @GetMapping("/export")
    public AjaxResult export(TPsbcCouponMarket psbcCouponMarket,
                             HttpServletResponse response) {
        return psbcCouponMarketService.exportFile(psbcCouponMarket);
    }

}
